<!DOCTYPE html>
<html lang="en">
<head>
    <title>管理系统 - 管理中心</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- <meta ng-include="'head.html'"> -->
    <style type="text/css">
        .btnOK{ height: 23px; padding: 0 10px; background: #f40; color: #fff; line-height: 23px; cursor: pointer; border: 0px; border-radius: 2px; background-clip: padding-box;
        }
        .lineInfo { height:50px }
        .titleHead { font-family: 宋体; font-size: 16px; font-weight: 400; margin-left: 15px }
        input[type="text"] {  width:250px; }
        input[type="password"] {  width:250px; }
    </style>
    <script src="../lib/js/jquery.min.js" type="text/javascript"></script>
    <script src="../js/build.js" type="text/javascript"></script>
    <script src="../js/public.js" type="text/javascript"></script>
</head>
<body class="flat-blue">
<div class="app-container H100" ng-app="myApp" ng-controller="myCtrl">
<div class="row content-container H100">
<div ng-include="'menus.html'" onload="loadReady()"></div>
<div class="container-fluid H100 pb15">
<div class="side-body padding-top H100" id="main" style="padding-top:70px">
    <!------------------Main---------------->
    <div class="H100" style="width:99%; background-color:#fff; position:relative">
        <div class="titleHead">➢账户安全</div>
        <div class="well well-sm" style="margin-top: 100px; padding-top: 40px">
            <div class="panel-body">

                <form class="form-horizontal" role="form">
                    <div style="color:red;padding-bottom: 30px ">
                        <div class="col-sm-4"> </div>
                        <div class="col-sm-8">{{error}}</div>
                    </div>
                    <div class="form-group">
                        <label for="password1" class="col-sm-4 control-label">原密码</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="password1"
                                   placeholder="请输入原密码" ng-model="password1">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="password2" class="col-sm-4 control-label">新密码</label>
                        <div class="col-sm-8">
                            <input type="password" class="form-control" id="password2" ng-click="password2=''"
                                   placeholder="请输入新密码" ng-model="password2" ng-change="error=''">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="password3" class="col-sm-4 control-label">重复输入</label>
                        <div class="col-sm-8">
                            <input type="password" class="form-control" id="password3" ng-blur="check()"
                                   ng-click="password3=''"
                                   placeholder="请输入新密码" ng-model="password3" ng-change="error=''">
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-offset-4 col-sm-8">
                            <button type="button" ng-click="OK()" class="btn btn-info"> 确 认 </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>



    </div>
    <!------------------End Main---------------------->
</div>  <!--End side-body-->
</div>  <!--End container-fluid-->
</div>  <!--End content-container-->
<div ng-include="'footer.html'"></div>
</div>  <!--End app-container-->

<script language="javascript">
    var app = angular.module('myApp', []);
    app.controller('myCtrl', function($scope) {
        loadCtlBase($scope);
        $scope.u = { };
        $scope.password1 = "";
        $scope.password2 = "";
        $scope.password3 = "";
        $scope.error = "";
        $scope.check = function(){
            if($scope.password3!=$scope.password2)$scope.error = "新密码两次输入不一致!";
        };

        $scope.OK = function (){
            if($scope.password1=="" || $scope.password2=="" || $scope.password3==""){
                $scope.error = "原密码和新密码均不能为空!";
                return;
            }
            if($scope.password3!=$scope.password2){
                $scope.error = "新密码两次输入不一致！";
                return;
            }

            ajaxData('change_user_password', {'p1':$scope.password1, 'p2':$scope.password2}, function(rst){
                var data = rst.data;  cout(data);
                if(data.error!=''){
                    $scope.error = data.error;
                }else{
                    $scope.error = "修改成功！";
                    $scope.password1 = "";
                    $scope.password2 = "";
                    $scope.password3 = "";
                }
                $scope.$apply();
            });
        };


    });



    
    
    $(document).ready(function(){
        // $("#fullH").heiht();

        /*
        $('.date').datetimepicker({
            format: 'yyyy-mm-dd', language:'zh-CN', autoclose:true, minView:"month"
        });
        */
    });


</script>

</body>
</html>
